import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'app-mall',
  templateUrl: './mall.component.html',
  styleUrls: ['./mall.component.scss']
})
export class MallComponent implements OnInit {


  constructor() { }

  mallData: any = [
    {
      name: '新春美装低价钜献',
      price: '低至29元',
      Image: 'assets/images/p(7).jpeg',
    },
    {
      name: '美邦轻薄羽绒服',
      price: '￥189元抢',
      Image: 'assets/images/p(4).jpeg',
    },
    {
      name: '韩版中长款棉衣',
      price: '￥219元抢',
      Image: 'assets/images/p(3).jpeg',
    },
    {
      name: '丝绒半身裙',
      price: '￥128元抢',
      Image: 'assets/images/p(6).jpeg',
    },
    {
      name: '高领长款毛衣',
      price: '￥158元抢',
      Image: 'assets/images/p(1).jpeg',
    },
    {
      name: '达芙妮显瘦高筒靴',
      price: '￥159元抢',
      Image: 'assets/images/p(5).jpeg',
    },
    {
      name: '加绒长款卫衣',
      price: '￥181元抢',
      Image: 'assets/images/p(2).jpeg',
    },
  ]


  ngOnInit() {
    this.getdata()
  }

  getdata() {

  }

  delMall(item: any, index: any) {

    console.log(item, index);

    // return
    let data = this.mallData;
    data.forEach((element: any, idx: any) => {
      if (index == idx) {
        data.splice(index, 1);
        this.mallData = data;
        console.log(this.mallData);

      }

    });
  }
}
